\contentsline {chapter}{Abstract}{ii}
\contentsline {chapter}{\numberline {1}Introducci\'on}{1}
\contentsline {section}{\numberline {1.1}Templates en C++}{1}
\contentsline {subsection}{\numberline {1.1.1}Especializaci\'on de templates}{2}
\contentsline {subsection}{\numberline {1.1.2}Conclusi\'on}{3}
\contentsline {section}{\numberline {1.2}Template Metaprogramming}{3}
\contentsline {section}{\numberline {1.3}Librer\IeC {\'\i }as Activas}{5}
\contentsline {paragraph}{}{5}
\contentsline {chapter}{\numberline {2}pHaskell}{7}
\contentsline {section}{\numberline {2.1}pHaskell desde el punto de vista del usuario final}{7}
\contentsline {paragraph}{}{7}
\contentsline {paragraph}{}{7}
\contentsline {paragraph}{}{7}
\contentsline {paragraph}{}{7}
\contentsline {paragraph}{}{8}
\contentsline {section}{\numberline {2.2}pHaskell y su motor funcional puro}{8}
\contentsline {subsection}{\numberline {2.2.1}Caracter\IeC {\'\i }sticas del motor funcional de pHaskell}{8}
\contentsline {subsection}{\numberline {2.2.2}Funciones currificadas}{8}
\contentsline {subsection}{\numberline {2.2.3}Funciones como valores de primer orden}{9}
\contentsline {subsection}{\numberline {2.2.4}Expresiones lambda \textbf {tipadas}}{9}
\contentsline {subsection}{\numberline {2.2.5}IF/ELSE}{9}
\contentsline {subsection}{\numberline {2.2.6}Definici\'on de funciones usando guardas}{9}
\contentsline {subsection}{\numberline {2.2.7}Pattern matching}{9}
\contentsline {subsection}{\numberline {2.2.8}Soporte nativo para listas}{10}
\contentsline {subsection}{\numberline {2.2.9}Pattern matching sobre listas}{10}
\contentsline {subsection}{\numberline {2.2.10}Definiciones locales en funciones}{10}
\contentsline {subsection}{\numberline {2.2.11}Tipos definidos por el usuario}{10}
\contentsline {subsection}{\numberline {2.2.12}\textbf {Full LAZY}}{11}
\contentsline {section}{\numberline {2.3}Definicion de pHaskell}{11}
\contentsline {paragraph}{}{11}
\contentsline {paragraph}{}{11}
\contentsline {paragraph}{}{12}
\contentsline {paragraph}{}{12}
\contentsline {paragraph}{}{12}
\contentsline {paragraph}{}{12}
\contentsline {paragraph}{}{12}
\contentsline {paragraph}{}{12}
\contentsline {paragraph}{}{12}
\contentsline {paragraph}{}{13}
\contentsline {paragraph}{}{13}
\contentsline {section}{\numberline {2.4}Generatrices}{13}
\contentsline {paragraph}{}{14}
\contentsline {paragraph}{}{14}
\contentsline {paragraph}{}{14}
\contentsline {paragraph}{}{14}
\contentsline {paragraph}{}{14}
\contentsline {section}{\numberline {2.5}Definicion de generatrices en pHaskell}{15}
\contentsline {section}{\numberline {2.6}pHaskell y C++}{15}
\contentsline {paragraph}{}{15}
\contentsline {paragraph}{}{15}
\contentsline {paragraph}{}{16}
\contentsline {paragraph}{}{16}
\contentsline {paragraph}{}{17}
\contentsline {paragraph}{}{17}
\contentsline {paragraph}{}{17}
\contentsline {subsection}{\numberline {2.6.1}El problema de los templates anidados }{17}
\contentsline {subsection}{\numberline {2.6.2}El problema de la evaluaci\'on eager }{17}
\contentsline {subsection}{\numberline {2.6.3}El problema de la especializaci\'on completa en templates anidados }{17}
\contentsline {subsection}{\numberline {2.6.4}$prelude.h$}{17}
\contentsline {paragraph}{}{18}
\contentsline {subsection}{\numberline {2.6.5}Utilizando librer\IeC {\'\i }as activas generadas por pHaskell}{18}
\contentsline {paragraph}{}{19}
\contentsline {chapter}{\numberline {3}Equivalencias entre haskell y template-metaprogramming}{20}
\contentsline {section}{\numberline {3.1} Motor Funcional puro }{20}
\contentsline {subsection}{\numberline {3.1.1} Equivalencia principal }{20}
\contentsline {paragraph}{}{20}
\contentsline {paragraph}{}{20}
\contentsline {paragraph}{}{21}
\contentsline {paragraph}{}{21}
\contentsline {paragraph}{}{21}
\contentsline {paragraph}{}{21}
\contentsline {paragraph}{}{21}
\contentsline {paragraph}{}{21}
\contentsline {subsection}{\numberline {3.1.2} Funciones con mas de un par\'ametro }{21}
\contentsline {paragraph}{}{22}
\contentsline {paragraph}{}{22}
\contentsline {paragraph}{}{22}
\contentsline {subsection}{\numberline {3.1.3} Pattern matching }{22}
\contentsline {paragraph}{}{22}
\contentsline {paragraph}{}{23}
\contentsline {paragraph}{}{23}
\contentsline {subsection}{\numberline {3.1.4} Tipos definidos por el usuario }{24}
\contentsline {paragraph}{}{24}
\contentsline {paragraph}{}{24}
\contentsline {paragraph}{}{25}
\contentsline {subsection}{\numberline {3.1.5} Listas }{25}
\contentsline {paragraph}{}{25}
\contentsline {paragraph}{}{25}
\contentsline {subsection}{\numberline {3.1.6} Sintactic sugar para parecerse mas a haskell }{25}
\contentsline {section}{\numberline {3.2} Generatrices }{25}
\contentsline {subsection}{\numberline {3.2.1} Equivalencia principal }{26}
\contentsline {subsection}{\numberline {3.2.2} Pensando en compilation time y runtime al mismo tiempo }{26}
\contentsline {subsection}{\numberline {3.2.3} Generatrices y pattern matching }{26}
\contentsline {subsection}{\numberline {3.2.4} Llamadas desde una generatriz a una funci\'on }{28}
\contentsline {chapter}{\numberline {4}Ejemplo: Solucionando un problema con una librer\IeC {\'\i }a activa}{30}
\contentsline {section}{\numberline {4.1}C\'alculo de SHA1 utilizando el algoritmo standard }{30}
\contentsline {section}{\numberline {4.2}C\'alculo de SHA1 utilizando una librer\IeC {\'\i }a activa desarrollada con pHaskell }{30}
\contentsline {section}{\numberline {4.3}Comparaci\'on de performance entre ambos m\'etodos }{30}
\contentsline {section}{\numberline {4.4}Conclusi\'on }{30}
\contentsline {chapter}{\numberline {5}Implementaci\'on de pHaskell}{31}
\contentsline {section}{\numberline {5.1} Arquitectura }{31}
\contentsline {section}{\numberline {5.2} Detalles de implementci\'on }{31}
